package org.ainlolcat.ainscience.entity;

import org.ainlolcat.ainscience.UpdateListener;
import org.ainlolcat.ainscience.column.Column;
import org.ainlolcat.ainscience.entity.links.Link;
import org.ainlolcat.ainscience.statistics.Statistic;
import org.ainlolcat.ainscience.templates.Template;

import javax.swing.*;
import java.util.Collection;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: ain                                                                   basicly
 * Date: 11/4/11
 * Time: 6:20 PM
 * To change this template use File | Settings | File Templates.
 */
public interface Entity {
    //define save or not entity in project
    public boolean isPersistent();
    public boolean isVisible();

    public EntityParser getParser();
    public JPanel getRenderer();

    public Template getTemplate();
    public String getType();

    //also SimpleEntity related only but set too deep for fast replace
    public Collection<Link> getLinks();
    public Link getLink(String name);
    public void setLink(Link link);
    public List<String> getDependencies();   //getData IDs of entities which linked to current entity.

    public void setID(Integer id);
    public Integer getID();

    public void setName(String name);
    public String getName();

    public Column getColumnByOrder(Integer id);
    public Column getColumnById(Integer id);
    public Column getColumnByName(String name);

    public Column getXColumn(String axis);

    //I doubt if this method safe but lets allow
    public void setColumn(Column column,Integer id);

    public void setStatistic(Statistic statistic);
    public Statistic getStatistic();

    public int getColumnCount();
    public int getRowCount();

    //added in purpose of update all dependencies if entity changed
    public boolean registerListener(UpdateListener listener);
    public boolean removeListener(UpdateListener listener);
}
